<template>
  <ul class="container">
    <li v-for="(item, index) in data" :key="index" class="item">
      <div :class="['item_index', (index+1)%2 === 0?'item_bg_black':'item_bg_blue']"> {{ index+1 }}</div>
      <div :class="['item_content', (index+1)%2 === 0?'item_bg_black':'item_bg_blue']">{{ item }}</div>
    </li>
  </ul>
</template>
<script setup>
import { ref, defineProps } from 'vue';
const props = defineProps({
  data: {
    type: Array,
    default: () => []
  }
});
</script>
<style lang="less" scoped>
.container {
  width: 100%;
  height: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
}
.item {
  height: 2.5rem;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.625rem;
  font-size: 1rem;
  margin-bottom: 3px;
  color: rgba(255, 255, 255, 0.85);
}
.item_index {
  width: 2.125rem;
  height: 100%;
  line-height: 2.5rem;
}

.item_content {
  width: calc(100% - 2.75rem);
  height: 100%;
  text-align: start;
  padding-left: 0.75rem;
  line-height: 2.5rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.item_bg_black {
  background: rgba(148, 169, 218, 0.05);
}

.item_bg_blue {
  background: rgba(22, 73, 143, 0.5);
}
</style>
